package com.javaee.term.mapper;

import com.javaee.term.data.ConverAnaly;
import com.javaee.term.data.TurnOver;
import com.javaee.term.model.Customer;
import org.apache.ibatis.annotations.Select;
import tk.mybatis.mapper.common.BaseMapper;

import java.util.List;

public interface CustomerMapper extends BaseMapper<Customer> {

    @Select("SELECT customer_name label, SUM(contact.contact_money) y \n" +
            "FROM `contact` LEFT JOIN customer on contact.customer_id = customer.customer_id\n" +
            "GROUP BY customer.customer_id\n" +
            "ORDER BY y DESC\n")
     List<TurnOver> getAllCustomerTurnOver();

}